// @ts-ignore
/* eslint-disable */
import { request } from '@umijs/max';

/** addCourse POST /api/course/add */
export async function addCourseUsingPost(body: API.CourseDTO, options?: { [key: string]: any }) {
  return request<API.ResultVoid_>('/api/course/add', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** deleteCourse DELETE /api/course/delete/${param0} */
export async function deleteCourseUsingDelete(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.deleteCourseUsingDELETEParams,
  options?: { [key: string]: any },
) {
  const { id: param0, ...queryParams } = params;
  return request<API.ResultVoid_>(`/api/course/delete/${param0}`, {
    method: 'DELETE',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** getCourseById GET /api/course/get/${param0} */
export async function getCourseByIdUsingGet(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.getCourseByIdUsingGETParams,
  options?: { [key: string]: any },
) {
  const { id: param0, ...queryParams } = params;
  return request<API.ResultCourseVO_>(`/api/course/get/${param0}`, {
    method: 'GET',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** listAllCourse GET /api/course/list */
export async function listAllCourseUsingGet(options?: { [key: string]: any }) {
  return request<API.ResultListCourseVO_>('/api/course/list', {
    method: 'GET',
    ...(options || {}),
  });
}

/** listCourseByStudentIdAndTeacherIdAndClassId GET /api/course/list/studentAndTeacherAndClass */
export async function listCourseByStudentIdAndTeacherIdAndClassIdUsingGet(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.listCourseByStudentIdAndTeacherIdAndClassIdUsingGETParams,
  options?: { [key: string]: any },
) {
  return request<API.ResultListCourseVO_>('/api/course/list/studentAndTeacherAndClass', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** pageCourses 分页查询根据学生id/课程id查询课程信息 POST /api/course/page */
export async function pageCoursesUsingPost(
  body: API.QueryCourseDTO,
  options?: { [key: string]: any },
) {
  return request<API.ResultPageCourseVO_>('/api/course/page', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** updateCourse PUT /api/course/update */
export async function updateCourseUsingPut(body: API.CourseDTO, options?: { [key: string]: any }) {
  return request<API.ResultVoid_>('/api/course/update', {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}
